package com.yupi.yuojcodesandbox.factory;

import com.yupi.yuojcodesandbox.sandbox.cplus.CplusDockerCodeSandbox;
import com.yupi.yuojcodesandbox.sandbox.java.JavaDockerCodeSandbox;
import com.yupi.yuojcodesandbox.sandbox.py.PythonDockerCodeSandbox;

/**
 * @Author: yuhao
 * @Date: 2025/3/13 15:32
 */
public class CodeSandBoxFactory {
    public static CodeSandbox createSandbox(String language) {
        switch (language.toLowerCase()) {
            case "c":
                return new CplusDockerCodeSandbox();
            case "java":
                return new JavaDockerCodeSandbox();
            case "python":
                return new PythonDockerCodeSandbox();
            default:
                throw new IllegalArgumentException("Unsupported language: " + language);
        }
    }
}
